import tushare as ts


def getDfDate():
    ts.set_token("04b7b8cec874d2d6e4ec9788f8b4d763ec9bc319aaf84dac107657c5")
    pro = ts.pro_api();
    df = pro.trade_cal(exchange='', start_date='20181022', end_date='20191020',
                       fields='exchange,cal_date,is_open', is_open='1')
    print(df)
    # print(type(df))
    return df

# if __name__ == "__main__":
#     df = getDfDate()
#     for index, row in df.iterrows():
#         print("交易日期:%s 开盘状态:%s" %(row["cal_date"], row["is_open"]))
#     print(type(df))
